package com.fegin.Hystrix.admin;

import com.fegin.VO.admin.ContentNewsVO;
import com.fegin.bean.admin.ContentNews;
import com.fegin.client.admin.AdminContentNewsFegin;
import com.util.Respons.ResponseUtil;
import feign.hystrix.FallbackFactory;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * @author 卫星
 * @package com.fegin.Hystrix.admin
 * @date 2019-03-05  14:43
 * @project CurrenCy-Cloud
 */
@Component
public class AdminContentNewsFeginHystrix implements FallbackFactory<AdminContentNewsFegin> {
    Logger logger = Logger.getLogger(AdminContentNewsFeginHystrix.class);

    @Override
    public AdminContentNewsFegin create(Throwable throwable) {
        return new AdminContentNewsFegin() {
            @Override
            public Map<String, Object> view(ContentNews contentNews) {
                return ResponseUtil.getExceptionMap();
            }

            @Override
            public Map<String, Object> newsList(ContentNewsVO contentNewsVO) {
                return ResponseUtil.getExceptionMap();
            }

            @Override
            public Map<String, Object> delNews(ContentNews contentNews) {
                return ResponseUtil.getExceptionMap();
            }
        };
    }
}
